How to change the date format in Doors 9.5.1.2?

Hi, when I have to query by date I have to pass the date in specific format:
yyyy-MM-dd'T'HH:mm:ss
But the date come from another system which is with different one, and I have to make pre-formatting of the date all the time, so I am wondering if there is a way to change the date format while queering to specific one for example:
yyyyMMddHHmmss

can be this configured somewhere in the Doors by some configuratioin?


Dinio - Tue Dec 01 06:05:32 EST 2015

Re: How to change the date format in Doors 9.5.1.2?
DoorsXLAustralia - Fri Dec 04 19:57:18 EST 2015

The following code lists all the date formats which DOORS understands based on your locale.

 

//  
//********************************************************************* 
void testFormat(Date dateValue, Locale loc, string format) 
// DESCRIPTION: Checks that the stringOf and dateOf perms are true 
//              inverses for the specified format. 
{ 
    print "    format " format ": " stringOf(dateValue, loc, format) "\n" 
} // testFormat 
//**************************************************************************** 
void testDate(Date dateValue, Locale loc) 
// Tests stringOf and dateOf using default formats, and all supported formats. 
{ 
    // Test default format 
    string stringForm = stringOf(dateValue, loc) 
    print "Default format: " stringForm "\n" 
     
    // Test all supported formats 
    string format 
    print "Short formats:\n" 
        for format in shortDateFormats(loc) do 
        { 
            testFormat(dateValue, loc, format) 
    } 
    print "Long formats:\n" 
        for format in longDateFormats(loc) do 
        { 
            testFormat(dateValue, loc, format) 
    } 
     
    // Test abbreviations. 
    print "Abbreviated names: " stringOf(dateValue, loc, "ddd, d MMM yy") "\n" 
    // Test all full names. 
    print "Full names: " stringOf(dateValue, loc, "dddd, d MMMM yyyy") "\n" 
     
} // testDate 
Locale loc = userLocale 
print "\nLOCALE: " (name loc) "\n" 
print "\nDATE ONLY:\n" 
testDate(today,loc) 
print "\nDATE AND TIME:\n" 
testDate(dateAndTime(today),loc) 

 

If the format you are using is not in the list then it will have to be modified using basic string manipulation.

Sean

Re: How to change the date format in Doors 9.5.1.2?
Dinio - Mon Dec 07 03:39:40 EST 2015

The problem hire is something in the configuration I think because:

    <rm_property:attrDef-7 rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"   >2012-07-02</rm_property:attrDef-7>

but 2012-07-02 is not DateTime is date, and I am wondering why Doors 9.5.1.2 behaves in that way? Why the date which is returns is not in the right format?

 

Re: How to change the date format in Doors 9.5.1.2?
donnacruickshank - Tue Mar 01 06:00:44 EST 2016

Dinio - Mon Dec 07 03:39:40 EST 2015

The problem hire is something in the configuration I think because:

    <rm_property:attrDef-7 rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"   >2012-07-02</rm_property:attrDef-7>

but 2012-07-02 is not DateTime is date, and I am wondering why Doors 9.5.1.2 behaves in that way? Why the date which is returns is not in the right format?

 

The default date format used by Rational DOORS is derived from the date format of the operating system in your current locale.

http://www-01.ibm.com/support/docview.wss?uid=swg21399067